/*
 * Point.h
 *
 *  Created on: May 29, 2011
 *      Author: gilang
 */

#ifndef POINT_H_
#define POINT_H_

class Point {
protected:
	double x,y,z;
public:
	Point(){}
    Point(double x,double y,double z){this->x=x;this->y=y;this->z=z;}
	virtual double get(int i){
		if(i==1)
			return x;
		else if(i==2)
			return y;
		else if(i==3)
			return z;
		else
			return 0;
	}
	virtual bool operator==(const Point &p){
		if(x==p.x && y==p.y && z==p.z)
			return true;
		return false;
	}
	virtual Point & operator=(const Point &p){
		x=p.x;
		y=p.y;
		z=p.z;
		return *this;
	}
	virtual Point operator+(const Point &p){
		return Point(x+p.x,y+p.y,z+p.z);
	}
	virtual ~Point(){}
};

#endif /* POINT_H_ */
